﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.ReworkManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.ReworkManagement.ReworkReasonVMs
{
    public partial class ReworkReasonTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._ReworkReason._ProductId")]
        public ExcelPropety ProductId_Excel = ExcelPropety.CreateProperty<ReworkReason>(x => x.ProductId);
        [Display(Name = "_Model._ReworkReason._ProductName")]
        public ExcelPropety ProductName_Excel = ExcelPropety.CreateProperty<ReworkReason>(x => x.ProductName);
        [Display(Name = "_Model._ReworkReason._ReasonName")]
        public ExcelPropety ReasonName_Excel = ExcelPropety.CreateProperty<ReworkReason>(x => x.ReasonName);
        [Display(Name = "_Model._ReworkReason._ReasonCode")]
        public ExcelPropety ReasonCode_Excel = ExcelPropety.CreateProperty<ReworkReason>(x => x.ReasonCode);
        [Display(Name = "_Model._ReworkReason._Active")]
        public ExcelPropety Active_Excel = ExcelPropety.CreateProperty<ReworkReason>(x => x.Active);
        [Display(Name = "_Model._ReworkReason._ReType")]
        public ExcelPropety ReType_Excel = ExcelPropety.CreateProperty<ReworkReason>(x => x.ReTypeId);
        [Display(Name = "_Model._ReworkReason._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<ReworkReason>(x => x.CreateTime, true);
        [Display(Name = "_Model._ReworkReason._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<ReworkReason>(x => x.UpdateTime, true);
        [Display(Name = "_Model._ReworkReason._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<ReworkReason>(x => x.CreateBy);
        [Display(Name = "_Model._ReworkReason._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<ReworkReason>(x => x.UpdateBy);
        [Display(Name = "_Model._ReworkReason._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<ReworkReason>(x => x.IsValid);
        [Display(Name = "_Model._ReworkReason._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<ReworkReason>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            ReType_Excel.DataType = ColumnDataType.ComboBox;
            ReType_Excel.ListItems = DC.Set<ReworkType>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class ReworkReasonImportVM : BaseImportVM<ReworkReasonTemplateVM, ReworkReason>
    {
            //import

    }

}